FROM sjqzhang/go-fastdfs:latest

ENV INSTALL_DIR /usr/local/go-fastdfs

ENV PATH $PATH:$INSTALL_DIR/

ENV GO_FASTDFS_DIR $INSTALL_DIR/data

WORKDIR $INSTALL_DIR

VOLUME $GO_FASTDFS_DIR

EXPOSE 8080

COPY cfg.json conf/

COPY docker-entrypoint.sh /usr/local/bin/

RUN echo 'nameserver 114.114.114.114' > /etc/resolv.conf && \
    wget https://rainbond-pkg.oss-cn-shanghai.aliyuncs.com/env2file -O /usr/local/bin/env2file \
    && chmod +x /usr/local/bin/docker-entrypoint.sh /usr/local/bin/env2file

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["fileserver" , "${OPTS}"]

